package whu.o2o.adapter;

import java.util.List;

import whu.o2o.R;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;



public class YZXZAdapter extends BaseAdapter {
	private LayoutInflater inflater;
	private Context context;
	public String[] yzmc = {"Ӣ��","��ͨ��","��������","����","����","����","����","����"};

	public YZXZAdapter(Context context) {
		super();
		this.context = context;
	
	}

	public int getCount() {
		return yzmc.length;
	}

	public Object getItem(int position) {
		return yzmc[position];
	}

	public long getItemId(int position) {
		return 0;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		final int p = position;
	
			if (convertView == null) {
				convertView = inflater.inflate(R.layout.register_jdyz_item,null);
			}
			TextView content = (TextView) convertView
					.findViewById(R.id.content);
		
			CheckBox cb = (CheckBox) convertView.findViewById(R.id.checkbox_select);
	
			content.setText(yzmc[p]);
		//    cb.setChecked();
		
		convertView.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				CheckBox cc=(CheckBox) v.findViewById(R.id.checkbox_select);
			 //   list.get(p).setCheckbox_state((cc.isChecked())?false:true);
				cc.toggle();
			}
		});
		return convertView;
	}

	
}
